package com.cheer.ba.amr;

import java.io.IOException;

/**
 * Created by Administrator on 2016/9/2 0002.
 */
public class AudioHelper {

    public static void toPcm(String source, String target) throws IOException {
//        long state = AmrDecoder.init();
//        File sourceFile = new File(source);
//        File targetFile = new File(target);
//        InputStream inputStream = new FileInputStream(sourceFile);
//        FileOutputStream out = new FileOutputStream(target);
//        DataOutputStream dataOutputStream = new DataOutputStream(out);
//        if (!targetFile.exists()) {
//            targetFile.createNewFile();
//        }
//        int c;
//        byte[] amrframe = new byte[32];//amr frame 32 bytes
//        short[] pcmframs = new short[160];//pcm frame 160 shorts
//        while ((c = inputStream.read(amrframe)) != -1) {
//            AmrDecoder.decode(state, amrframe, pcmframs);
//        }
//        reader.close();
//
//        AmrDecoder.exit(state);

    }
}
